import request from '@/utils/request'

// 新增老师
export function addGoods(data) {
    return request({
        url: '/admin/goods',
        method: 'post',
        data,
        showLoading: true
    })
}

// 老师详情
export function getGoodsDetail(id) {
    return request({
        url: '/admin/goods/' + id,
        method: 'get',
        showLoading: true
    })
}
// 修改老师
export function editGoods(data) {
    return request({
        url: '/admin/goods',
        method: 'put',
        data,
        showLoading: true
    })
}
// 批量删除老师
export function delGoods(idList) {
    return request({
        url: '/admin/goods/' + idList,
        method: 'delete',
    })
}

export function listGoods(data) {
    return request({
        url: '/admin/goods/list',
        method: 'post',
        data
    })
}

// 初始化SKU
export function skuInit(data) {
    return request({
        url: `/admin/goods/sku/init`,
        data,
        method: 'post',
    })
}
// 初始化SKU
export function addSku(data) {
    return request({
        url: `/admin/goods/sku`,
        data,
        method: 'post',
    })
}
// 修改sku
export function editSku(data) {
    return request({
        url: `/admin/goods/sku`,
        data,
        method: 'put',
    })
}
// 初始化sku
export function deleteSku(idList) {
    return request({
        url: `/admin/goods/sku/${idList}`,
        method: 'delete',
    })
}
